home *** CD-ROM | disk | FTP | other *** search
/ Floppyshop 2 / Floppyshop - 2.zip / Floppyshop - 2.iso / art&graf.ix / art-0015 / flicker / flicker.h < prev    next >
C/C++ Source or Header  |  1997-04-16  |  5KB  |  144 lines

  1.  
  2. /* screen format defines */
  3. #define    XMAX    320
  4. #define    YMAX    200
  5. #define COLORS    16
  6. #define BITPLANES 4
  7.  
  8. #define WORD int
  9. typedef int (*Vector)();
  10.  
  11. #define NULL 0L
  12.  
  13. /* stuff for dynamic memory management */
  14. extern WORD *alloc();
  15. #define Alloc_a(type) (type *)alloc(sizeof(type) )
  16. #define Free_a(pt)    mfree(pt, sizeof(*(pt) ) )
  17. extern long cel_mem_alloc;    /* how much memory we got */
  18. extern long mem_free;        /* how much is left */
  19.  
  20. /* Stuff to handle the various screens of flicker */
  21. #define MAX_SCREENS 128
  22. extern WORD screen_ix, screen_ct;    /* which screen we're on and # of screens */
  23. extern WORD *screens[MAX_SCREENS];
  24. extern WORD *pscreen;            /* points to physical (visible) screen */
  25. extern WORD *bscreen;            /* points to buffer screen for double-buffer */
  26. extern WORD *cscreen;                /* points to the "drawing/display" screen */
  27.                                     /* cscreen -> pscreen or bscreen */
  28.  
  29. extern WORD sys_cmap[];            /* software echo of color map */
  30. extern char oppositec[];    /* lookup table for opposite colors */
  31.  
  32. extern WORD ccolor;        /* the color to draw thing with */
  33. extern WORD filled_flag;    /* do we do fills or outlines? */
  34. extern WORD nozero_flag;    /* zero-suppress in the copies? */
  35. extern WORD degas;            /* load/save pics in degas or neo format? */
  36. extern WORD zoom_flag;        /* fat bits mode? */
  37. extern WORD zoomx, zoomy;    /* offset of zoom */
  38. extern WORD zscale_cursor;    /* adjust mousex mousey to reflect
  39.                                 zoom position */
  40.  
  41. extern WORD firstx, firsty;    /* pen-tools use these to place where first
  42.                                 pendown was */
  43. extern WORD x_0, y_0, x_1, y_1;    /* first and mouse coordinates sorted */
  44.  
  45. extern WORD white, black, red;    /* closest fit to menu colors, set by
  46.                                     find_colors() */
  47. extern WORD mouse_on;    /* used by check input to record if mouse is onscreen 
  48.                             or not */
  49.  
  50. /*  These are globals that contain the input state */
  51. extern WORD mouse_button, omouse_button;  /* button state and last state */
  52. extern WORD mouse_x, mouse_y;    /* the xy position of mouse */
  53. extern WORD lastx, lasty;    /* last mouse_x, mouse_y */
  54. extern WORD mouse_moved;    /* new mouse input? */
  55. extern WORD key_hit;            /* 1 if keyboard hit, 0 otherwise */
  56. extern long key_in;                /* What the extended character code 
  57.                                    for when key_hit = 1 */
  58.  
  59. /* These are macros on the mouse buttons */
  60. #define PDN (mouse_button & 0x100)
  61. #define RDN (mouse_button & 0x200)
  62. #define EDN (mouse_button & 0x300)
  63. #define PJSTDN ( (mouse_button & 0x100) && !(omouse_button & 0x100) )
  64. #define RJSTDN ( (mouse_button & 0x200) && !(omouse_button & 0x200) )
  65.  
  66.  
  67. extern WORD *brushes[];    /* array of pointers to all our brushes */
  68. extern WORD brush_ix;    /* index of brush, 0 = none */
  69. extern WORD use_brush_cursor;    /* messy flag to see if cursor is cross or
  70.                                     current brush ... depends on current
  71.                                     pentool */
  72.  
  73. extern long get60hz();    /* 60 Hz clock */
  74.  
  75. struct cel
  76.     {
  77.     WORD xoff, yoff;
  78.     WORD width, height;
  79.     WORD cmap[16];
  80.     WORD *image;
  81.     unsigned WORD image_size;
  82.     WORD *mask;
  83.     };
  84. typedef struct cel Cel;
  85. extern Cel *alloc_cel();
  86. extern Cel *clipping;
  87.  
  88. struct seq_header
  89.     {
  90.     WORD magic;        /* == 0xfedc */
  91.     WORD version;
  92.     long cel_count;
  93.     char pad[120];
  94.     };
  95. typedef struct seq_header Seq_header;
  96.  
  97. struct neo_head
  98. {
  99.     int type;  /* 0 for neo, 1 for programmed pictures, 2 for cels? */
  100.     int resolution; /*0 lores, 1 medium, 2 hires*/
  101.     int colormap[16];
  102.     char filename[8+1+3];
  103.     int ramp_seg; /*hibit active, bits 0-3 left arrow, 4-7 right arrow*/
  104.     char ramp_active;  /*hi bit set if actively cycled*/
  105.     char ramp_speed;  /*60hz ticks between cycles*/
  106.     int slide_time;  /*60hz ticks until next picture*/
  107.     int xoff, yoff;  /*upper left corner of cel*/
  108.     int width, height; /*dimensions of cel*/
  109.     char pad[66]; /*stuff with zeros for now*/
  110. };
  111.  
  112. struct degas_head
  113.     {
  114.     WORD res;
  115.     WORD colormap[16];
  116.     };
  117. extern char *get_fname();    /* request file name from user */
  118.  
  119. /* handy macro to find out how much memory a raster line takes up */
  120. #define Raster_line(width) (((((width)+15)>>3)&0xfffe)<<2)
  121. #define Raster_block(width, height) (Raster_line(width)*height)
  122.  
  123.  
  124. /* This is the tree structure that is the core of the pull-down system */
  125. struct pull
  126.     {
  127.     struct pull *next;
  128.     WORD xoff, yoff, width, height;
  129.     struct pull *children;
  130.     char *data;  /* actually just some old pointer, must agree with see function
  131.                  */
  132.     Vector see;
  133.     };
  134. typedef struct pull Pull;
  135.  
  136. /* some defines to make it easier to edit skeletal pull data files... */
  137. #define NONEXT NULL
  138. #define NOCHILD NULL
  139. #define NODATA NULL
  140.  
  141. /*some functions to put into pull->see */
  142. extern pull_block(), pull_color(), pull_oblock(), pull_text(), pull_brush();
  143.  
  144.